package learn_250211;

public class Bubble {
    public static  void main(String[] args){
        int[] a = {3,4,1,2,5};
        bubble_sort(a);
        for (int i : a) {
            System.out.print(i + " ");
        }
    }

    public static void bubble_sort(int[] a){
        for(int i=0;i<a.length;i++){
            for(int j=0;j<a.length-i-1;j++){
                if (a[j]>a[j+1]){
                    int tmp = a[j+1];
                    a[j+1] = a[j];
                    a[j] = tmp;
                }
            }
        }
    }
}
